Skip to content

Instantly share code, notes, and snippets.

@barbietunnie
barbietunnie / udemy-courses-download-using-cookies.md
Last active May 10, 2024 18:17
Downloading Udemy videos with youtube-dl

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@vookimedlo
vookimedlo / macos_mute_unmute.md
Last active May 10, 2024 18:16
MacOS: mute & unmute from command line

Mute volume

osascript -e "set volume with output muted"

Unmute volume

osascript -e "set volume without output muted"
@karpathy
karpathy / min-char-rnn.py
Last active May 10, 2024 18:13
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@xmonkee
xmonkee / vscode-theme.json
Created February 22, 2024 03:27
Default VSCode themes for Zed
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"name": "Visual studio code themes",
"author": "Microsoft",
"themes":[
{
"name": "Light (Visual Studio)",
"appearance": "light",
"style": {
"border": null,
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 10, 2024 18:16
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@Yousha
Yousha / .gitignore
Last active May 10, 2024 18:12
.gitignore for C/C++ developers.
##### Windows
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
@pesterhazy
pesterhazy / building-sync-systems.md
Last active May 10, 2024 18:10
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@webketje
webketje / README.md
Last active May 10, 2024 18:09
Soundcloud Downloader Clean - Tampermonkey userscript OR bookmarklet

Tampermonkey userscript - Soundcloud Downloader Clean

An ad-less, multilingual, clean Soundcloud downloader with robust code. Adds a 'Download' button to all single track views.

Features

  • No third-party embeds, redirects or ads, directly uses the Soundcloud API.
@0xmjk
0xmjk / pyspark-df-lowercase.py
Created December 14, 2017 19:01
Make all column names in a DataFrame lowercase (PySpark)
# chain DataFrame.withColumnRenamed() calls for each df.schema.fields
df = reduce(lambda chain, column: chain.withColumnRenamed(*column),
map(lambda field: (field.name, str.lower(field.name)),
df.schema.fields),
df)
@ericmjl
ericmjl / ds-project-organization.md
Last active May 10, 2024 18:06
How to organize your Python data science project

UPDATE: I have baked the ideas in this file inside a Python CLI tool called pyds-cli. Please find it here: https://github.com/ericmjl/pyds-cli

How to organize your Python data science project

Having done a number of data projects over the years, and having seen a number of them up on GitHub, I've come to see that there's a wide range in terms of how "readable" a project is. I'd like to share some practices that I have come to adopt in my projects, which I hope will bring some organization to your projects.

Disclaimer: I'm hoping nobody takes this to be "the definitive guide" to organizing a data project; rather, I hope you, the reader, find useful tips that you can adapt to your own projects.

Disclaimer 2: What I’m writing below is primarily geared towards Python language users. Some ideas may be transferable to other languages; others may not be so. Please feel free to remix whatever you see here!